package com.zhb.cloud;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.zhb.cloud.repository.AccountRepository;
import com.zhb.cloud.service.AccountService;

/**
 * @ClassName: MyCloudJtaApplication
 * @author: zhb
 * @date: 2017年5月15日 上午8:59:02
 * @Description: 分布式事物测试
 *
 */
@SpringBootApplication
public class MyCloudJtaApplication {
	@Autowired
	private static AccountService service;
	@Autowired
	private static AccountRepository repository;

	public static void main(String[] args) {
		SpringApplication.run(MyCloudJtaApplication.class, args);
		service.createAccountAndNotify("josh");
		System.out.println("Count is " + repository.count());
		try {
			service.createAccountAndNotify("error");
		} catch (Exception ex) {
			System.out.println(ex.getMessage());
		}
		System.out.println("Count is " + repository.count());
	}
}
